package com.h2cloud.workflow;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @author: wulongkai
 * @create: 2023-03-03 10:53
 **/

public class test3 {
    public static void main(String[] args) {
//        salary sa = new salary();
//        System.out.println(sa);

//        List<Long> listResult = null;
//        System.out.println("CollectionUtils.isEmpty(listResult) = " + CollectionUtils.isEmpty(listResult));
//
//        Set<String> noticeUserOaList = new HashSet<>();
//        noticeUserOaList.remove(null);
//
//        Gson gson = new Gson();
//
//        List<String> list = new ArrayList<>();
//        list.add("你好");
//        list.add("hllo、");
//        System.out.println("list.toString() = " + list.toString());
//
//        List<String> nameList = gson.fromJson(list.toString(), new TypeToken<List<String>>() {
//        }.getType());
//        System.out.println("nameList = " + nameList);
//
//        fun3 f = new fun3();
//        f.say();
//
//        String[] split = "512-zhuguichong-sz".split("-", 2);
//        System.out.println(Arrays.toString(split));
//
//        split = "512-zhuguichong".split("-", 2);
//        System.out.println(Arrays.toString(split));

//        User u1 = new User(12, "12L");
//        User u7 = new User(12, "12L");
//        User u2 = new User(12, "12LL");
//
//        User u3 = new User(13, "13L");
//        User u4 = new User(13, "13L");
//
//        User u5 = new User(11, "11L");
//        User u6 = new User(14, "14L");
//
//        List<User> list = Arrays.asList(u2, u1, u3, u4, u5, u6, u7);
//        ArrayList<User> collect1 = list.stream().collect(
//                // 将集合先放到 treeSet 集合然后将他们转换成数组
//                Collectors.collectingAndThen(
//                        Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(user -> user.getId() + user.getUser())))
//                        , ArrayList::new)
//        );
//
//        collect1.forEach(System.out::println);
        // https://mp.weixin.qq.com/s/GqYjwYdFEpIgzK1YnvmYWw
    }

}


@Accessors(chain = true)
@Data
@AllArgsConstructor
class User {
    int id;
    String user;
}

@Accessors(chain = true)
@Data
class salary {
    private transient int age;
    private transient String name;

    private transient inner in;

    public int getAge() {
        init();
        return in.getAge();
    }

    public String getName() {
        init();
        return in.getName();
    }

    public void init() {
        if (in != null) {
            return;
        }

        inner i = new inner();
        i.setAge(12);
        i.setName("longkai");

        in = i;
    }
}

@Accessors(chain = true)
@Data
class inner {
    private transient int age;
    private transient String name;
}

interface fun1 {
    default void say() {
        System.out.println("hello");
    }
}

class fun2 implements fun1 {

}

class fun3 extends fun2 {
    public void say() {
        System.out.println("hi");
    }
}